<template>
  <a-modal width="50%" :visible="visible" @ok="handleOk" @cancel="handleCancel">
    <template #title> 拒绝变更 </template>
    <div class="content">
      <a-form :model="{}" auto-label-width :layout="'vertical'" ref="refForm1">
        <a-form-item show-colon label="拒绝原因" field="baseSetting">
          <template #label>
            拒绝原因
            <a-tooltip
              content="注：是否拒绝变更当前考核变更，确认后还是原考核方案！"
            >
              <icon-info-circle-fill style="color: #165dff; font-size: 16px" />
            </a-tooltip>
          </template>
          <a-textarea v-model="formData" />
        </a-form-item>
      </a-form>
    </div>
  </a-modal>
</template>

<script lang="ts" setup>
import { useVModel } from '@vueuse/core';

const props = withDefaults(
  defineProps<{
    visible: boolean;
    rejectReason?: string;
  }>(),
  {
    visible: false
  }
);

const emit = defineEmits([
  'update:visible',
  'update:rejectReason',
  'confirmRejecct'
]);
const formData = useVModel(props, 'rejectReason', emit);
// 保存
const handleOk = async () => {
  emit('update:visible', false);
  emit('confirmRejecct');
};

// 取消
const handleCancel = () => {
  emit('update:visible', false);
};
</script>

<style scoped lang="less">
//
</style>
